package com.meishij.fragment;


import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.facebook.drawee.view.SimpleDraweeView;
import com.meishij.R;
import com.meishij.entry.RecommendEntry;

/**
 * A simple {@link Fragment} subclass.
 */
public class RecommendCateresFragment extends Fragment {


    private Bundle arguments;

    public static RecommendCateresFragment getInstance() {
        return new RecommendCateresFragment();
    }

    public RecommendCateresFragment() {
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        return inflater.inflate(R.layout.fragment_recommend_body_cateres_item, container, false);
    }

    @Override
    public void onViewCreated(View view, @Nullable Bundle savedInstanceState) {
        arguments = getArguments();
        RecommendEntry.ObjBean.SanCanBean sanCanBean1 = (RecommendEntry.ObjBean.SanCanBean) arguments.getSerializable("sanCanBean1");
        RecommendEntry.ObjBean.SanCanBean sanCanBean2 = (RecommendEntry.ObjBean.SanCanBean) arguments.getSerializable("sanCanBean2");
        RecommendEntry.ObjBean.SanCanBean sanCanBean3 = (RecommendEntry.ObjBean.SanCanBean) arguments.getSerializable("sanCanBean3");
        RecommendEntry.ObjBean.SanCanTitlesBean sanCanTitlesBean = (RecommendEntry.ObjBean.SanCanTitlesBean) arguments.getSerializable("sanCanTitlesBean");

        View fragment_recommend_body_cateres_item_one = view.findViewById(R.id.fragment_recommend_body_cateres_item_one);
        TextView recommend_body_cateres_item_images_textview_title_one = (TextView) fragment_recommend_body_cateres_item_one.findViewById(R.id.recommend_body_cateres_item_images_textview_title);
        recommend_body_cateres_item_images_textview_title_one.setText(sanCanBean1.getTitle());
        TextView recommend_body_cateres_item_images_textview_sub_title_one = (TextView) fragment_recommend_body_cateres_item_one.findViewById(R.id.recommend_body_cateres_item_images_textview_sub_title);
        recommend_body_cateres_item_images_textview_sub_title_one.setText(sanCanBean1.getDescr());
        SimpleDraweeView recommend_body_cateres_item__images_titlepic_one = (SimpleDraweeView) fragment_recommend_body_cateres_item_one.findViewById(R.id.recommend_body_cateres_item__images_titlepic);
        recommend_body_cateres_item__images_titlepic_one.setAspectRatio(1);
        recommend_body_cateres_item__images_titlepic_one.setImageURI(Uri.parse(sanCanBean1.getTitlepic()));
        
        View fragment_recommend_body_cateres_item_two = view.findViewById(R.id.fragment_recommend_body_cateres_item_two);
        TextView recommend_body_cateres_item_images_textview_title_two = (TextView) fragment_recommend_body_cateres_item_two.findViewById(R.id.recommend_body_cateres_item_images_textview_title);
        recommend_body_cateres_item_images_textview_title_two.setText(sanCanBean2.getTitle());
        TextView recommend_body_cateres_item_images_textview_sub_title_two = (TextView) fragment_recommend_body_cateres_item_two.findViewById(R.id.recommend_body_cateres_item_images_textview_sub_title);
        recommend_body_cateres_item_images_textview_sub_title_two.setText(sanCanBean2.getDescr());
        SimpleDraweeView recommend_body_cateres_item__images_titlepic_two = (SimpleDraweeView) fragment_recommend_body_cateres_item_two.findViewById(R.id.recommend_body_cateres_item__images_titlepic);
        recommend_body_cateres_item__images_titlepic_two.setImageURI(Uri.parse(sanCanBean2.getTitlepic()));
        
        View fragment_recommend_body_cateres_item_three = view.findViewById(R.id.fragment_recommend_body_cateres_item_three);
        TextView recommend_body_cateres_item_images_textview_title_three= (TextView) fragment_recommend_body_cateres_item_three.findViewById(R.id.recommend_body_cateres_item_images_textview_title);
        recommend_body_cateres_item_images_textview_title_three.setText(sanCanBean3.getTitle());
        TextView recommend_body_cateres_item_images_textview_sub_title_three = (TextView) fragment_recommend_body_cateres_item_three.findViewById(R.id.recommend_body_cateres_item_images_textview_sub_title);
        recommend_body_cateres_item_images_textview_sub_title_three.setText(sanCanBean3.getDescr());
        SimpleDraweeView recommend_body_cateres_item__images_titlepic_three = (SimpleDraweeView) fragment_recommend_body_cateres_item_three.findViewById(R.id.recommend_body_cateres_item__images_titlepic);
        recommend_body_cateres_item__images_titlepic_three.setImageURI(sanCanBean3.getTitlepic());

        TextView recommend_body_cateres_item_textview_one = (TextView) view.findViewById(R.id.recommend_body_cateres_item_textview_one);
        recommend_body_cateres_item_textview_one.setText(sanCanTitlesBean.getTitle());
        
        TextView recommend_body_cateres_item_textview_two = (TextView) view.findViewById(R.id.recommend_body_cateres_item_textview_two);
        recommend_body_cateres_item_textview_two.setText(sanCanTitlesBean.getSub_title());

    }
} 
